from selenium import webdriver
import time
# 打开chrome
driver = webdriver.Firefox()
# 百度
driver.get('https://www.baidu.com')
# 输入天气
driver.find_element_by_id('kw').send_keys('天气预报')
time.sleep(2)
# 关闭
driver.quit()